import Alert from '@material-ui/lab/Alert';
import './kalert.less'
import React from 'react'
import { connect } from 'react-redux'

function KAlert(props) {
    return (
        <Alert style={{display: props.alertShow ? 'flex':'none'}} className="k-alert" variant="filled" severity={props.alertType}>
            {props.alertMsg}
        </Alert>
    )
}
const mapStateToProps = (state)=>{
    return {
        alertMsg: state.alertMsg,
        alertType: state.alertType,
        alertShow: state.alertShow
    }
}
export default connect(mapStateToProps,null)(KAlert)
